<template>
	<div>
		我是父组件
		<!-- 使用组件 -->
		<child :person="person" :info="info"></child>
		<button @click="btnClick()">父传子演示</button>
	</div>
</template>

<script>
	import child from "./Child.vue" //导入组件
	export default{
		name:'Parent',
		data() {
			return{
				person:{name:'张珊',age:19},
				info:34
			}
		},
		components:{
			child  //声明组件
		},
		methods:{
			btnClick(){
				this.person.name = "张三丰"
				this.person.age = 100
			}
		},
		mounted(){
			console.log("父组件载入后")
		},
		created() {
			console.log("父组件创建完成")
		},
		
	}
</script>

<style>
</style>